set(PROJECT_NAME server)
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99")

project(${PROJECT_NAME})

file(GLOB_RECURSE SOURCES_FILES	"${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
file(GLOB_RECURSE HEADERS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")

list(REMOVE_DUPLICATES SOURCES_FILES)
list(REMOVE_DUPLICATES HEADERS_FILES)

source_group ("Header Files" FILES ${HEADERS_FILES})
source_group ("Source Files" FILES ${SOURCES_FILES})

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/")
if(WIN32)
link_libraries(${PROJECT_NAME} ws2_32.lib)
endif(WIN32)
add_executable(${PROJECT_NAME} ${HEADERS_FILES} ${SOURCES_FILES})